import './extend'

export let createStyleMixin = function (keys = ['']) {

  let methods = {
  }

  keys.forEach(key => {
    if (key) {
      methods['set' + key.alFirstUpperCase() + 'Style'] =
        function(value)  {
         this.$set(this.styleMap, key, value)
      }
      methods['get' + key.alFirstUpperCase() + 'Style'] =
        function() {
        return this.styleMap[key]
        }
    }
  })

  return {
    data() {
      return {
        styleMap: {}
      }
    },
    methods,
  }
}
